import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class PageOne extends JFrame {
    private JTextField password = new JTextField("输入密码", 45);
    private JTextField email = new JTextField("输入邮箱", 18);
    private JLabel at = new JLabel("@");
    private JTextField domain = new JTextField("输入域名", 18);
    private JComboBox<String> combo = new JComboBox<>();
    private RectangleButton cancel = new RectangleButton("取消");
    private JLabel next = new JLabel("下一步");
    private JLabel reset = new JLabel("重置");
    private JPanel mainPane = new JPanel();
    private JPanel emailPane = new JPanel();
    private JPanel passwordPane = new JPanel();
    private JPanel inputPane = new JPanel();
    private JPanel confirmPane = new JPanel();
    private Container c = getContentPane();
    public PageOne() {
        super("User Inyerface - Enter Your Password");
        initialize();
    }
    private void initialize() {
        setSize(640, 480);
        setVisible(true);
        setResizable(false);
        setDefaultCloseOperation(3);
        c.setBackground(new Color(12, 88, 218));
        mainPane.setBackground(new Color(12, 88, 218));
        passwordPane.setBackground(Color.white);
        emailPane.setBackground(Color.white);
        passwordPane.setLayout(new FlowLayout());
        passwordPane.add(password);
        password.setForeground(Color.GRAY);
        emailPane.setLayout(new FlowLayout());
        emailPane.add(email);
        emailPane.add(at);
        emailPane.add(domain);
        emailPane.add(combo);
        combo.addItem(".org");
        combo.addItem(".co.uk");
        combo.addItem(".net");
        combo.addItem(".gov");
        combo.addItem(".de");
        combo.addItem(".fr");
        combo.addItem(".nl");
        combo.addItem(".com");
        combo.addItem(".be");
        combo.addItem(".jpg");
        combo.setEditable(false);
        email.setForeground(Color.GRAY);
        domain.setForeground(Color.GRAY);
        confirmPane.setLayout(new FlowLayout());
        confirmPane.add(next);
        confirmPane.add(cancel);
        confirmPane.add(reset);
        next.setFont(new Font("微软雅黑", Font.PLAIN, 15));
        reset.setFont(new Font("微软雅黑", Font.PLAIN, 15));
        cancel.setFont(new Font("微软雅黑", Font.PLAIN, 15));
        next.setForeground(Color.GRAY);
        reset.setForeground(Color.GRAY);
        cancel.setForeground(Color.WHITE);
        confirmPane.setBackground(Color.white);
        inputPane.setLayout(new BoxLayout(inputPane, BoxLayout.Y_AXIS));
        inputPane.setBackground(Color.white);
        inputPane.add(passwordPane);
        inputPane.add(emailPane);
        inputPane.add(confirmPane);
        mainPane.add(inputPane);
        c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS));
        addGasp();
        addGasp();
        addGasp();
        addGasp();
        addGasp();
        addGasp();
        addGasp();
        addGasp();
        c.add(mainPane);
    }
    private void addGasp() {
        c.add(Box.createVerticalStrut(20));
    }
    public static void main(String[] args) {
        new PageOne();
    }
}